package com.markus.basic.设计模式.静态代理模式;

/**
 * Author:markusZhang
 * Date:Create in 2020/8/30 14:22
 * todo:
 */
public class ProxyImage implements Image{
    private RealImage realImage;
    private String fileName;
    public ProxyImage (String fileName) {
        this.fileName = fileName;
    }

    @Override
    public void display() {
        if (realImage == null){
            realImage = new RealImage(fileName);
        }
        realImage.display();
    }
}
